<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>		
<meta charset="UTF-8">
<title>班级成绩管理</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
	function cx() {
		var bjId=$('#bj').val();
		var kcId=$('#kc').val();
		if(kcId==0||bjId==0){
			$('#table').empty();
		}else{
			$('#table').load('grade',{method:'getClassGrade',bjId:bjId,kcId:kcId});
		}
	}
	function cjChange(id,value) {
		$.post('grade',{method:'cjChange',id:id,grade:value},function(data){});
	}
	function selectChange() {
		$('table').empty();
	}
	function fandeng() {
		window.location="login.jsp"
	}	
	function fanzhu() {
		window.location="main?method=main"
	}	
</script>
</head>
<body>
	<p>
		<label>班级：</label>
		<select id="bj" onchange="selectChange()">
			<option value="0">--请选择--</option>
			<c:forEach items="${bjs}" var="bj">
				<option value="${bj.id}">${bj.name}</option>
			</c:forEach>
		</select>
		<label>课程：</label>
		<select id="kc" onchange="selectChange()">
			<option value="0">--请选择--</option>
			<c:forEach items="${kcs}" var="kc">
				<option value="${kc.id }"> ${kc.name}</option>		
			</c:forEach>
		</select>
		<button onclick="cx()" class="button1">查询</button>
	</p>
	<div id="table">
	<button onclick="fandeng()" class="btn">返回登录页面</button>
	<button onclick="fanzhu()" class="btn">返回主页面</button>
	</div>
</body>
</html>